# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2023年03月16日
"""
import openpyxl

myBook=openpyxl.load_workbook('收入表.xlsx')
mySheet=myBook.active
myColDsum=sum([myCell.value for myCell in mySheet['D'][4:]])
myColCsum=sum([myCell.value for myCell in mySheet['C'][4:]])
myColBsum=sum([myCell.value for myCell in mySheet['B'][4:]])
mySheet['D9']=myColDsum
mySheet['C9']=myColCsum
mySheet['B9']=myColBsum
mySheet['A9']='合计'

myBook.save('收入表.xlsx')
